import render from 'src/hrpub/common/frame/render';

import mainAction from '../actions/main';

import {createPage} from 'nc-lightapp-front';

import './index.less';
import HomePage from "../components/Home";
import DetailPage from "../components/Detail";
import {COMMON} from "../unit/util";
import {THEME} from "../../../public/theme/theme";

const Wrapper =  render({
    actions: {
        mainAct: mainAction
    }
})(({props, action, state}, {customData}) => {
    let {staffCom} = props;
    return (
        <div className={`staff_composition ${THEME.bgCommon} ${THEME.fontc}`}>
            {staffCom.page === COMMON.pageMain?<HomePage
                {...props}
            />:<DetailPage
                {...props}
            />}
        </div>
    )
});
let billinfo = [];
let tableIdObj = COMMON.tableIdObj;
let pagecode = COMMON.appConfig.pagecode;
for (let key in tableIdObj) {
    billinfo.push({
        billtype: 'grid',
        pagecode,
        bodycode: tableIdObj[key]
    })
}
export default createPage({
    billinfo
})(Wrapper)
